export function goUserPage(id) {
    console.log('打开用户主页', id);
    window.pupu &&
        window.pupu.openUserHomePage &&
        window.pupu.openUserHomePage(id);
    window.webkit &&
        window.webkit.messageHandlers &&
        window.webkit.messageHandlers.openUserHomePage &&
        window.webkit.messageHandlers.openUserHomePage.postMessage(id);
}

export function goConfession() {
    console.log('去告白');
    window.pupu && window.pupu.createDynamic && window.pupu.createDynamic();
    window.webkit &&
        window.webkit.messageHandlers &&
        window.webkit.messageHandlers.createDynamic &&
        window.webkit.messageHandlers.createDynamic.postMessage('');
}

export function goHisConfession(id) {
    console.log('Ta的告白', id);
    window.pupu &&
        window.pupu.gotoDynamicDetail &&
        window.pupu.gotoDynamicDetail(id);
    window.webkit &&
        window.webkit.messageHandlers &&
        window.webkit.messageHandlers.gotoDynamicDetail &&
        window.webkit.messageHandlers.gotoDynamicDetail.postMessage(id);
}

export function closeFun() {
    console.log('关闭界面');
    window.pupu && window.pupu.close && window.pupu.close();
    window.webkit &&
        window.webkit.messageHandlers &&
        window.webkit.messageHandlers.close &&
        window.webkit.messageHandlers.close.postMessage('');
}

export function showToast(msg) {
    console.log('Toast提示', msg);
    window.pupu && window.pupu.showToast && window.pupu.showToast('msg');
    window.webkit &&
        window.webkit.messageHandlers &&
        window.webkit.messageHandlers.showToast &&
        window.webkit.messageHandlers.showToast.postMessage('msg');
}
